#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <stack>
#include <list>

using namespace std;

void Test1()
{
	string s1("Hello World");
	string s2(s1);
	string s3(s1, 5, 3);
	string s4(s1, 5);
	string s5(10, '#');

	cout << s1 << endl;
	cout << s2 << endl;
	cout << s3 << endl;
	cout << s4 << endl;
	cout << s5 << endl;

	cout << "auto :";
	for (auto e : s1)
	{
		cout << e << " ";
	}
	cout << endl;


}

void Test2()
{
	stack<int> s1;
	s1.push(1);
	s1.push(2);
	s1.push(3);
	s1.push(4);
	s1.push(5);

	cout << "stack: ";
	while (s1.empty())
	{
		cout << s1.top() << " ";
		s1.pop();
	}
}

void Test3()
{
	list<int> l1;
	l1.push_back(1);
	l1.push_back(2);
	l1.push_back(3);
	l1.push_back(4);
	l1.push_back(5);
	l1.push_back(6);

	list<int>::iterator itl1 = l1.begin();
	while (itl1 != l1.end())
	{
		cout << *itl1 << " ";
		itl1++;
	}
	cout << endl;

	cout << "list auto:";
	for (auto e : l1)
	{
		cout << e << " ";
	}
	cout << endl;
}

int main()
{
	Test1();
	Test2();
	Test3();

	return 0;
}